package cloudContact;

import org.scribe.builder.ServiceBuilder;
import org.scribe.builder.api.FacebookApi;
import org.scribe.oauth.OAuthService;
import org.scribe.model.Token;

public class FacebookManager {

	public static final String CONSUMER_KEY = "223129037711851";
	public static final String CONSUMER_SECRET = "007d3f193c21a4653c2f80dd4a59bbb3";
	public static final String SCOPE = "friends_photos,friends_location,friends_checkins";
	public static final String CALLBACK_URL = "http://cloudctac.dyndns.org/CloudContact/FacebookOAuthCallback";
	public static final Token EMPTY_TOKEN = null;
	public static final String PROTECTED_RESOURCE_URL = "https://graph.facebook.com/me";

	private FacebookManager() {}
	
	private static OAuthService service = null;

	public static OAuthService getOAuthService() {
		if (service == null) {
			service = new ServiceBuilder().provider(FacebookApi.class)
					.apiKey(CONSUMER_KEY)
					.apiSecret(CONSUMER_SECRET)
					.callback(CALLBACK_URL)
					.scope(SCOPE).build();
		}
		return service;
	}
}
